package com.nulldev.util.web.dns.server.server;

import java.net.SocketAddress;
import java.nio.ByteBuffer;

public class DNSPayload {
	private SocketAddress remoteAddress;

    private ByteBuffer messageData;

    /**
     * Creates a new payload from the supplied address and message data.
     * @param remoteAddress
     * @param messageData
     */
    public DNSPayload(SocketAddress remoteAddress, ByteBuffer messageData) {
        this.remoteAddress = remoteAddress;
        this.messageData = messageData;
    }

    /**
     * Get the address for this payload.
     * @return
     */
    public SocketAddress getRemoteAddress() {
        return remoteAddress;
    }

    /**
     * Set the remote address for this payload.
     * @param remoteAddress
     */
    public void setRemoteAddress(SocketAddress remoteAddress) {
        this.remoteAddress = remoteAddress;
    }

    /**
     * Get the binary DNS message data for this payload.
     * @return
     */
    public ByteBuffer getMessageData() {
        return messageData;
    }

    /**
     * Set the binary DNS message data for this payload.
     * @param messageData
     */
    public void setMessageData(ByteBuffer messageData) {
        this.messageData = messageData;
    }
}
